package bfa.gps;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.RectF;

public class AlarmSpeedArc extends SpeedArc {
    
	float dark=10;
	float bright=5;
	
    public Paint getPaint() {
    	if (paintR1==null) {
    		paintR1=new Paint();
    		    	
    	    paintR1.setColor(color);
    	    paintR1.setStrokeWidth(9);
    	    //paintR1.setAlpha(200);
    	    paintR1.setStyle(Paint.Style.STROKE);
    	    paintR1.setAntiAlias(true);
    	    
    	    paintR1.setPathEffect(new DashPathEffect(new float[] {dark,bright}, 0));

    	}
    	
    	return paintR1;
    }
    
    
    
    Paint paintR2=null;
    public Paint getPaint2() {
    	if (paintR2==null) {
    		paintR2=new Paint();
    		    	
    	    paintR2.setColor(Color.WHITE);
    	    paintR2.setStrokeWidth(9);
    	    //paintR2.setAlpha(200);
    	    paintR2.setStyle(Paint.Style.STROKE);
    	    paintR2.setAntiAlias(true);
    	    
    	    paintR2.setPathEffect(new DashPathEffect(new float[] {bright,dark}, bright));

    	}
    	
    	return paintR2;
    }
    
    
    public void drawArc(Canvas canvas,RectF r2) {
    	canvas.drawArc(
			r2, 
			angleFrom, 
			angleTo, 
			false, 
			getPaint()
		);

    	canvas.drawArc(
			r2, 
			angleFrom, 
			angleTo, 
			false, 
			getPaint2()
		);

    }
}
